package topcoder.srm579;

import java.util.Arrays;

public class PrimalUnlicensedCreatures {
	public int maxWins(int init, int[] grezPower)
	{
		Arrays.sort(grezPower);
		
		int ans = 0;
		for(int gr : grezPower) {
			if (init > gr) {
				init += (gr / 2);
				ans++;
			} else
				break;
		}
		return ans;
	}
	
	public static void main(String[] args) 
	{
		PrimalUnlicensedCreatures puc = new PrimalUnlicensedCreatures();
		int[] grezPower = {7, 8, 9, 10};
		int init = 7;
		System.out.println(puc.maxWins(init, grezPower));
	}

}
